<template>
  <div class="dashboard-container">
    <div class="dashboard-text">当前登录工号为: {{ userId }}</div>
  </div>
</template>

<script>
export default {
  name: 'Dashboard',
  data() {
    return {
      userId: ''
    }
  },
  created() {
    this.getUserId()
  },
  methods: {
    getUserId() {
      const userId = sessionStorage.getItem('userId')
      this.userId = userId
      var reloadCookie = sessionStorage.getItem('reloadUserType2')
      if (reloadCookie === '1') {
        sessionStorage.setItem('reloadUserType2', 2)
      } else if (reloadCookie === '2' || reloadCookie === null) {
        sessionStorage.setItem('reloadUserType2', 1)
        location.reload()
      }
    }

  }

}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
